package function;

import java.util.Random;

public class Lady {
	double money;
	
	public void shopping () {
		System.out.println("这位女士在购物");
		Random random = new Random();
		int price = random.nextInt(100) + 100; // 100-199
		System.out.println("她看好一件价格为" + price + "元的裙子");
		if (money >= price) {
			money -= price;
			System.out.println("买了这条裙子,剩余" + money);
		}else {
			System.out.println("钱不够，走了");
		}
	}
	
	public static void main(String[] args) {
		Lady gaga = new Lady();
		gaga.money = 150;
		gaga.shopping();
	}
}
